import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * collection模块-收藏信息
 */
@Entity('collection_info')
export class CollectionInfoEntity extends BaseEntity {
  @Index()
  @Column({ comment: '收藏ID', length: 50 })
  collectionId: string;

  @Index()
  @Column({ comment: '用户ID', length: 50 })
  userId: string;

  @Index()
  @Column({ comment: '内容ID', length: 50 })
  contentId: string;

  @Column({ comment: '类型 0-文章 1-视频 2-图片', default: 0, type: 'tinyint' })
  type: number;

  @Column({ comment: '状态 0-未收藏 1-已收藏', default: 0, type: 'tinyint' })
  status: number;

  @Column({ comment: '备注', nullable: true })
  remark: string;

  @Column({ comment: '创建时间', type: 'datetime' })
  createTime: Date;

  @Column({ comment: '更新时间', type: 'datetime' })
  updateTime: Date;

  @Column({ comment: '操作人', length: 50, nullable: true })
  operator: string;

  @Column({ comment: '操作时间', type: 'datetime', nullable: true })
  operateTime: Date;
}